<%@ page contentType="text/html;charset=UTF-8"%>
 <%@page import="com.augurit.common.system.web.auth.form.LoginUserForm"%>
 <%LoginUserForm form=(LoginUserForm)request.getSession().getAttribute("SES_LOGIN_USER"); %>
<%
String context=request.getContextPath();
String id=request.getParameter("id");
String  templateCode=request.getParameter("templateCode");   
 %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>导入企业正式信息</title>
<!-- Ext CSS -->
<!-- Ext CSS -->
<link href="<%=context %>/resources/js/ext/resources/css/ext-all.css" rel="stylesheet" type="text/css"/>
<link href="<%=context %>/resources/css/aos/ext-patch.css" rel="stylesheet" type="text/css"/>

<!-- Ext JS -->
<script src="<%=context %>/resources/js/ext/adapter/ext/ext-base.js" type="text/javascript"></script>
<script src="<%=context %>/resources/js/ext/ext-all.js" type="text/javascript"></script>
    
<!-- Ext 中文汉化 -->
<script src="<%=context %>/resources/js/ext/src/locale/ext-lang-zh_CN.js" type="text/javascript"></script>
    
<!-- 自定义JS及CSS -->
<link href="<%=context %>/resources/css/aos/ExtComponent.css" rel="stylesheet" type="text/css"/>
<link href="<%=context %>/wf/public/wf.css" rel="stylesheet" type="text/css"/>
<link href="<%=context %>/resources/css/aos/aos_blue.css" rel="stylesheet" type="text/css"/>

<script src="<%=context %>/resources/js/aos/ext_ux/ExtCustomization.js" type="text/javascript"></script>
<script src="<%=context %>/wf/public/WfPublic.js" type="text/javascript"></script>

<script>
    var ctx = "${ctx}";
    Ext.BLANK_IMAGE_URL="${ctx}/resources/js/ext/resources/images/default/s.gif"
</script>
<script type="text/javascript">  
Ext.onReady(function(){ 
var  url="<%=context%>/yw-rq-qyzz-info!showview.action?id="+<%=id%>;
	var width=document.body.clientWidth;
	var height=document.body.clientHeight;
	if(height==0){
		height=document.documentElement.clientHeight;
	}
	
	new Ext.Panel({   
         title : "导入企业正式信息",   
         width : width,   
         height : height, 
         titleCollapse : true,   
         collapsible : true,   
         html : '<iframe id="finalqyzzInfo" name="finalqyzzInfo" src="'+url+'" frameborder="0" width="'+width+'px" height="'+height+'px"></iframe>',   
         renderTo : "p1",   
         tbar : _tbar 
	});  
});
    
var _tbar = new Ext.Toolbar({   
                buttons : [ {   
                    text : "导入",   
                    iconCls:'images/add.png',
                    handler : importFinalQydata  
                },{   
                    text : "退出",   
                    iconCls:'images/add.png',
                    handler : exitwin  
                } ]   
            });   

  function importFinalQydata(){
         var  action="<%=context%>/yw-rq-qyzz-info!showview.action?id="+<%=id%>;
         var  url="<%=context%>/yw-rq-qyzz-info!importFinalQyData.action";
         Ext.MessageBox.confirm('警告!','您确定要导入吗?',function(btn){
        if (btn == 'yes'){
          var id=document.frames["finalqyzzInfo"].document.getElementById("id").value;
          Ext.Ajax.request({
                     url:url,
                     params:{id:id},
                     method:'POST',
                     success:function(response){
                         var result=response.responseText;
                         Ext.MessageBox.alert('系统提示','成功导入！',function(){
                                 document.frames["finalqyzzInfo"].location.href=action;
                         });
                        //window.close();
                    },
                    failure: function() {
                        Ext.Msg.alert('错误', '请求失败,请稍后重试'); 
                     } 
               });
        }
        });      
   }
 function exitwin(){
    window.close();
 }
            
</script>
</head>

<body>
<form action="">
 <div id='p1'></div> 
 </form>
</body>
</html>
